<template>
  <div>
    <parent></parent>
  </div>
</template>
<script>
import { ref, reactive, computed, watch, provide } from "vue";
import { useRouter, useRoute } from "vue-router";
import { useStore } from 'vuex';
import parent from "./father.vue";
export default {
  name: '',
  components: {
    parent
  },
  setup () {
    //  1. app组件数据传递给child
    const count = ref(0);
    provide("count", count);

    // 2.讲函数传递给children,调用时候传回数据
    const updateCount = (num) => {
        console.log(num, "proVide获取到的传回来的值");
        count.value += num;
    }
    provide("updateUpdate", updateCount)
    return {

    };
  },
}
</script>
<style scoped>

</style>